using System;
using System.Data;
using System.Collections.Generic;
using AIM.Common;
using AIM.Model;
using System.Collections;
using BrightFrame.Aop;
namespace AIM.BLL
{
    [Connection]
    public class ArchiveVBLL : ContextBoundObject
    {
        private readonly AIM.DAL.ArchiveVDAL _archiveVDAL = new AIM.DAL.ArchiveVDAL();
        private readonly AIM.DAL.ArchiveFileDAL _archiveFileDAL = new DAL.ArchiveFileDAL();
        private readonly AIM.DAL.ArchiveFDAL _archiveFDAL = new DAL.ArchiveFDAL();

        public DataSet ADS(int custodyPeriod, string chooseArchiveType, int startYear, int endYear)
        {
            return _archiveVDAL.ADS(custodyPeriod, chooseArchiveType, startYear, endYear);
        }

        public void Add(ArchiveV archiveV)
        {
            _archiveVDAL.Add(archiveV);
        }

        public void Update(ArchiveV archiveV)
        {
            _archiveVDAL.Update(archiveV);
        }

        public ArchiveV GetModel(long archiveVID)
        {
            return _archiveVDAL.GetModel(archiveVID);
        }

        public DataTable Query(out int countRecord, int start, int limit, Hashtable queryParameters)
        {
            return _archiveVDAL.Query(out countRecord, start, limit, queryParameters);
        }

        [TransactionMethod]
        public void DeleteArchiveVIDs(string archiveVIDs)
        {
            _archiveFileDAL.DeleteByArchiveVIDs(archiveVIDs);
            _archiveFDAL.DeleteByArchiveVIDs(archiveVIDs);
            _archiveVDAL.DeleteByArchiveVIDs(archiveVIDs);
        }

        public DataTable GetByCategory(string archiveTypeID, string categoryID, string startNum, string endNum)
        {
            return _archiveVDAL.GetByCategory(archiveTypeID, categoryID, startNum, endNum);
        }

        public List<string> GetCategoryIDByArchiveTypeID(int archiveTypeID)
        {
            return _archiveVDAL.GetCategoryIDByArchiveTypeID(archiveTypeID);
        }

        public DataTable QueryArchive(Hashtable parameters)
        {
            return _archiveVDAL.QueryArchive(parameters);
        }
    }
}

